package com.wxzz.elearing.livetelecast.api.server;

import com.wxzz.elearing.livetelecast.service.IPlatformLivetelecastService;
import com.wxzz.elearning.common.vo.ReturnVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.Map;


@RestController
@RequestMapping("/wx-livetelecast-api")
public class WxLivetelecastApi {

    @Autowired
    private IPlatformLivetelecastService platformLivetelecastService;

    /**
     * 支付成功确认
     *
     * @param userOrderId
     * @return
     */
    @RequestMapping(value = "handlerNotifyLive/{userOrderId}", method = RequestMethod.POST)
    public ReturnVO<String> handlerNotifyLive(@PathVariable Long userOrderId) {
        return platformLivetelecastService.handlerNotifyLive(userOrderId);
    }

    /**
     * 支付回调修改打赏金额(返回讲师id)
     *
     * @return
     */
    @RequestMapping(value = "updateRewardAmount", method = RequestMethod.POST)
    public ReturnVO<Long> updateRewardAmount(@RequestBody Map<String, String> map) {
        return platformLivetelecastService.updateRewardAmount(map);
    }

    /**
     * 总直播数
     *
     * @return
     */
    @RequestMapping(value = "countByPlatformLivetelecast", method = RequestMethod.POST)
    public Integer countByPlatformLivetelecast() {
        return platformLivetelecastService.countByPlatformLivetelecast();
    }

    /**
     * 总活动数
     *
     * @return
     */
    @RequestMapping(value = "countByActivity", method = RequestMethod.POST)
    public Integer countByActivity() {
        return platformLivetelecastService.countByActivity();
    }
}
